home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 7_7.lha / 7_7 / 7_7.h < prev    next >
Text File  |  1993-08-08  |  793b  |  35 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / an iterator for a doubly-linked list
  6. lass dlist_iterator
  7.  
  8.    dlink *curr;
  9.    dlist *curr_dlist;
  10.  
  11. ublic:
  12.    dlist_iterator(dlist &d)
  13.    { curr_dlist = &d; curr = 0; }
  14.  
  15.    // set current pointer to the ends of the list
  16.    void reset() { curr = 0; }
  17.  
  18.    // move around the list, leaving the links there
  19.    int next(ent &e);
  20.    int prev(ent &e);
  21.  
  22.    // move around the list, removing the links
  23.    int getnext(ent &e);
  24.    int getprev(ent &e);
  25.  
  26.    // manipulate around the beginning
  27.    // and end of the list
  28.    void insert(ent e);
  29.    void append(ent e);
  30.  
  31.    // manipulate around the current entry
  32.    void inserthere(ent e);
  33.    void appendhere(ent e);
  34. ;
  35.